#include<iostream> 
#include<cmath>
using namespace std;
int main()
{
	char ch;
	int num;
    int ans=0;
	cin>>num;
	int n=sqrt((num+1)/2);
	cin>>ch;
	for(int i=n;i>=1;i--)
	{
		for(int j=1;j<=n-i;j++)
		{
			cout<<' ';
		}
		for(int j=1;j<=2*i-1;j++)
		{
			cout<<ch;
            ans++;
		}
		cout<<endl;
	}
	for(int i=2;i<=n;i++)
	{
		for(int j=1;j<=n-i;j++)
		{
			cout<<' ';
		}
		for(int j=1;j<=2*i-1;j++)
		{
			cout<<ch;
            ans++;
		}
		cout<<endl;
	}
    cout<<num-ans<<endl;
	return 0;
}
